]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Unset Idle ID before removing it
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 9 May 2019 19:51:17 +0000 (14:51 -0500)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 9 May 2019 20:08:20 +0000 (15:08 -0500)
When toggling keyboard various times, we might get an error because trying to
disconnect an idle that isn't set anymore.

This is because when we remove the idle, we don't unset the ID.
Also clear the idle when destroying the keyboard.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/540

js/ui/keyboard.js

index 6d4585de85651ea671e97fdec9eb11035c6cfa09..df2e3ed2f8448812b0a928b3238bad2005e1745f 100644 (file)
@@ -1144,6 +1144,7 @@ var Keyboard = class Keyboard {
             this._keyboardController.disconnect(this._keypadVisibleId);
         if (this._focusNotifyId)
             global.stage.disconnect(this._focusNotifyId);
+        this._clearShowIdle();
         this._keyboard = null;
         this.actor.destroy();
         this.actor = null;
@@ -1229,6 +1230,7 @@ var Keyboard = class Keyboard {
         if (!this._showIdleId) {
           this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
               this.show(Main.layoutManager.focusIndex);
+              this._showIdleId = 0;
               return GLib.SOURCE_REMOVE;
           });
           GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.show');